What's New in WebGPU (Chrome 137)

François Beaufort
François Beaufort

Published: May 26, 2025

Use texture view for externalTexture binding

A compatible GPUTextureView (2D, single subresource) is now allowed to be used in place of a GPUExternalTexture binding when creating a GPUBindGroup.

This simplifies shader logic in video effects pipelines where both GPUExternalTexture (for source video) and GPUTextureView (for intermediate processing) have to be handled. It also reduces the need to dynamically compile shaders depending on where the texture comes from. See Intent to Ship: WebGPU: GPUTextureView for externalTexture binding.

const texture = myDevice.createTexture({
  size: [42, 42],
  format: navigator.gpu.getPreferredCanvasFormat(),
  usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING,
});

const code = `
@group(0) @binding(0) var texture : texture_external;
@group(0) @binding(1) var<storage, read_write> buffer: vec2u;
    
@compute @workgroup_size(1) fn main() {
  buffer = textureDimensions(texture);
}`;

const pipeline = myDevice.createComputePipeline({
  layout: "auto",
  compute: { module: myDevice.createShaderModule({ code }) },
});

const bindGroup = myDevice.createBindGroup({
  layout: pipeline.getBindGroupLayout(0),
  entries: [
    { binding: 0, resource: texture.createView() }, // Use texture view for an externalTexture binding
    { binding: 1, resource: { buffer: myBuffer } },
  ],
});

Buffers copy without specifying offsets and size

A new GPUCommandEncoder method overload lets developers omit offsets and size parameters when using copyBufferToBuffer() to simplify the copy of entire buffers. See Intent to Ship: WebGPU: copyBufferToBuffer overload.

const size = 42;
const srcBuffer = myDevice.createBuffer({
  size,
  usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC,
});
const dstBuffer = myDevice.createBuffer({
  size,
  usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ,
});

// Copy entire buffer.
myCommandEncoder.copyBufferToBuffer(srcBuffer, dstBuffer);

// This is the same as the following.
// myCommandEncoder.copyBufferToBuffer(srcBuffer, 0, dstBuffer, 0, size);

WGSL workgroupUniformLoad using pointer to atomic

A new workgroupUniformLoad(ptr) overload in WGSL has been added for developer convenience. It atomically loads the value pointed to by ptr and returns it to all invocations in the workgroup, where ptr is a pointer-to-atomic inside a workgroup variable. See issue 408241039.

@group(0) @binding(0) var<storage, read_write> buffer : array<u32, 1>;

var<workgroup> wgvar : atomic<u32>;

@compute @workgroup_size(1, 1)
fn main(@builtin(local_invocation_index) lid: u32) {
  if (lid == 0) {
    atomicStore(&(wgvar), 42u);
  }
  buffer[lid] = workgroupUniformLoad(&wgvar);
}

GPUAdapterInfo powerPreference attribute

The non-standard powerPreference GPUAdapterInfo string attribute is now available when the user has enabled the "WebGPU Developer Features" flag at chrome://flags/#enable-webgpu-developer-features. If supported, the powerPreference value can be either "low-power" or "high-performance" depending on the GPUPowerPreference value that was used in GPURequestAdapterOptions. See CL 6438860.

function checkPowerPreferenceForGpuDevice(device) {
  const powerPreference = device.adapterInfo.powerPreference;
  if (powerPreference === "high-performance") {
    // High-performance GPU detected. Enabling enhanced graphics settings.
  } else if (powerPreference === "low-power") {
    // Low-power GPU detected. Optimizing for battery life.
  }
}

Remove GPURequestAdapterOptions compatibilityMode attribute

The experimental GPURequestAdapterOptions compatibilityMode attribute has been removed in favor of the standardized featureLevel attribute added in Chrome 133. See issue 366151404.

Dawn updates

Developers can build WebGPU projects in languages like C++, using webgpu.h to target both WebAssembly and specific platforms. Dawn's newly-released "emdawnwebgpu" ("Emscripten Dawn WebGPU") implements the latest standardized webgpu.h over the browser API.

Emdawnwebgpu is a (maintained) fork of Emscripten's (now unmaintained) built-in bindings (USE_WEBGPU). All new development is being done on emdawnwebgpu, and Emscripten's built-in bindings will be removed as developers transition to emdawnwebgpu. Emdawnwebgpu's C header is very close to Dawn's, whereas the built-in bindings are significantly outdated.

Download emdawnwebgpu from Dawn's GitHub releases page and read the package's README.md for information on how to use it. The source files can be found in the Dawn repository.

For a complete guide, check out the updated Build an app with WebGPU documentation.

This covers only some of the key highlights. Check out the exhaustive list of commits.

What's New in WebGPU

A list of everything that has been covered in the What's New in WebGPU series.

Chrome 137

Chrome 136

Chrome 135

Chrome 134

Chrome 133

Chrome 132

Chrome 131

Chrome 130

Chrome 129

Chrome 128

Chrome 127

Chrome 126

Chrome 125

Chrome 124

Chrome 123

Chrome 122

Chrome 121

Chrome 120

Chrome 119

Chrome 118

Chrome 117

Chrome 116

Chrome 115

Chrome 114

Chrome 113